The Week View component > Using the Week View component > Creating an application with the Week View component |
Creating an application with the Week View component
The following procedure describes how to use the Week View component. In this procedure, you enter simple ActionScript code that configures how days are represented, and then traces the date of the selected item. For more complex examples, see Examples for the Week View component.
To create a simple application using the Week View component:
1 |
Open Macromedia Flash MX. |
2 |
Open the Components panel (Window > Components). |
3 |
Select Flash UI Components Set 5 from the Components panel menu. |
4 |
Drag an instance of the Week View component onto the stage. |
5 |
Set the instance name of the component to myWeekView_wkv. |
6 |
Add a new layer to the main timeline and name it actions. |
7 |
Select the new layer and open the Actions panel (Window > Actions). |
8 |
In the Actions panel add the following code: |
var days_fr = ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"];
var months_fr = ["jan", "fev", "mar", "avr", "mai", "jui", "jui",
"aou", "sep", "oct", "nov", "dec"];
myWeekView_wkv.setDayArray(days_fr);
myWeekView_wkv.setMonthArray(months_fr);
function onDayChange()
{
trace("Selected Date : " + myWeekView_wkv.getValue());
}
myWeekView_wkv.setChangeHandler("onDayChange"); |
|
9 |
Save, publish, and test the movie. There will be a week view component which uses French abbreviations to represent the days and months, and which will trace the date whenever the selected date is changed by the user. |
You can view the code for this example in the week_simple_example.fla example file.